package com.xxxx.service.impl;

import com.xxxx.pojo.Product;
import com.xxxx.service.ProductService;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class ProductServiceImpl implements ProductService {
	@Override
	public List<Product> selectPro() {
		return Arrays.asList(
				new Product(1,"手机1",2,588d),
				new Product(2,"手机2",2,588d),
				new Product(3,"手机3",2,588d)
		);
	}

	@Override
	public Map<Object, Object> createP(Product product) {
		System.out.println(product);
		return new HashMap<Object, Object>(){{
			put("code","200");
			put("msg","success");
		}};
	}

	@Override
	public Product selectById(Integer id) {
		return new Product(id,"手机1",2,588d);
	}
}
